package com.dong.component;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

import java.util.Arrays;

/**
 * description
 *
 * @author Administrator 2021/09/02 18:48
 */
public class ComponentTest {

    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext("com.dong.component");

        MyBean myBean = (MyBean) context.getBean(MyBean.class);
        final String[] names = context.getBeanNamesForAnnotation(Qualifier.class);
        System.out.println(Arrays.toString(names));
        System.out.println(myBean);

        MyService myService = context.getBean(MyService.class);
        System.out.println(myService);
    }

}
